<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<div class='form-group'>
				<label class='col-md-2 control-label'>visitpayid</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='visitpayid' type='text' name='visitpayid' id='visitpayid' data-bv-notempty='true' data-bv-notempty-message='visitpayid 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>hostcode</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='hostcode' type='text' name='hostcode' id='hostcode' data-bv-notempty='true' data-bv-notempty-message='hostcode 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>itemno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='itemno' type='text' name='itemno' id='itemno' data-bv-notempty='true' data-bv-notempty-message='itemno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>patientid</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='patientid' type='text' name='patientid' id='patientid' data-bv-notempty='true' data-bv-notempty-message='patientid 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>visitno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='visitno' type='text' name='visitno' id='visitno' data-bv-notempty='true' data-bv-notempty-message='visitno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>itemname</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='itemname' type='text' name='itemname' id='itemname' data-bv-notempty='true' data-bv-notempty-message='itemname 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>itemclass</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='itemclass' type='text' name='itemclass' id='itemclass' data-bv-notempty='true' data-bv-notempty-message='itemclass 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>paycosts</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='paycosts' type='text' name='paycosts' id='paycosts' data-bv-notempty='true' data-bv-notempty-message='paycosts 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>visitdate</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='visitdate' type='text' name='visitdate' id='visitdate' data-bv-notempty='true' data-bv-notempty-message='visitdate 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>prescno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='prescno' type='text' name='prescno' id='prescno' data-bv-notempty='true' data-bv-notempty-message='prescno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>serialno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='serialno' type='text' name='serialno' id='serialno' data-bv-notempty='true' data-bv-notempty-message='serialno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>units</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='units' type='text' name='units' id='units' data-bv-notempty='true' data-bv-notempty-message='units 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>price</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='price' type='text' name='price' id='price' data-bv-notempty='true' data-bv-notempty-message='price 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>amount</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='amount' type='text' name='amount' id='amount' data-bv-notempty='true' data-bv-notempty-message='amount 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>itemspec</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='itemspec' type='text' name='itemspec' id='itemspec' data-bv-notempty='true' data-bv-notempty-message='itemspec 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>performedby</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='performedby' type='text' name='performedby' id='performedby' data-bv-notempty='true' data-bv-notempty-message='performedby 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>orderedby</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='orderedby' type='text' name='orderedby' id='orderedby' data-bv-notempty='true' data-bv-notempty-message='orderedby 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>dqbm</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='dqbm' type='text' name='dqbm' id='dqbm' data-bv-notempty='true' data-bv-notempty-message='dqbm 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>phone</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='phone' type='text' name='phone' id='phone' data-bv-notempty='true' data-bv-notempty-message='phone 不能为空'>
				</div>
			</div>


			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='appVisitPayList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="add()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});
		
		function add() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'post',
				url : '/appVisitPays',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("添加成功", {shift: -1, time: 1000}, function(){
                        location.href = "appVisitPayList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
